unit uPrinc;

interface

uses
  Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
  Vcl.Controls, Vcl.Forms, Vcl.Dialogs, cxGraphics, cxControls, cxLookAndFeels,
  cxLookAndFeelPainters, dxNavBarCollns, cxClasses, dxNavBarBase, dxNavBar,
  dxBar, dxRibbon, dxRibbonMiniToolbar, dxStatusBar, dxRibbonStatusBar, UCBase,
  UCIdle, UCDataConnector, UCFireDACConn, Vcl.Menus, Firedac.Dapt, Vcl.StdCtrls,
  cxButtons, Vcl.ImgList, Vcl.ExtCtrls, cxPC, dxDockPanel, dxDockControl,
  dxNavBarStyles, dxSkinsCore, dxSkinOffice2010Blue, dxSkinsdxNavBarPainter,
  Vcl.Grids, Vcl.DBGrids;

type
  TFormPrinc = class(TForm)
    dxRibbonStatusBar1: TdxRibbonStatusBar;
    dxNavBar1: TdxNavBar;
    dxNavBar1Group1: TdxNavBarGroup;
    dxNavBar1Item1: TdxNavBarItem;
    dxNavBar1Item2: TdxNavBarItem;
    dxNavBar1Item3: TdxNavBarItem;
    dxNavBar1Item4: TdxNavBarItem;
    dxNavBar1Item5: TdxNavBarItem;
    dxNavBar1Item6: TdxNavBarItem;
    dxNavBar1Item7: TdxNavBarItem;
    UserControl1: TUserControl;
    UCIdle1: TUCIdle;
    UCControls1: TUCControls;
    MainMenu1: TMainMenu;
    Usurios1: TMenuItem;
    Cadastrs1: TMenuItem;
    LogOff1: TMenuItem;
    rocarSenha1: TMenuItem;
    dxNavBar1Group2: TdxNavBarGroup;
    cxImageList2: TcxImageList;
    UCFireDACConn1: TUCFireDACConn;
    dxNavBar1Item8: TdxNavBarItem;
    dxNavBar1Group3: TdxNavBarGroup;
    dxNavBar1Group4: TdxNavBarGroup;
    dxNavBar1Item9: TdxNavBarItem;
    dxNavBar1Item10: TdxNavBarItem;
    dxNavBar1Item11: TdxNavBarItem;
    Sair1: TMenuItem;
    dxNavBar1StyleItem1: TdxNavBarStyleItem;
    dxNavBar1Item12: TdxNavBarItem;
    dxNavBar1Item13: TdxNavBarItem;
    DBGrid1: TDBGrid;
    Histricos1: TMenuItem;
    procedure FormCreate(Sender: TObject);
    procedure FormClose(Sender: TObject; var Action: TCloseAction);
    procedure dxNavBar1Item1Click(Sender: TObject);
    procedure dxNavBar1Item2Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  FormPrinc: TFormPrinc;
  CaminhoExe : String;
  FormAtivo : TForm;

implementation

{$R *.dfm}

uses uDmCon, uFuncoes, uCadClie, uPai, uConsulta;

procedure TFormPrinc.dxNavBar1Item1Click(Sender: TObject);
begin
   Application.CreateForm(TFormCadClie, FormCadClie);
end;

procedure TFormPrinc.dxNavBar1Item2Click(Sender: TObject);
begin
   ExecutaForm(TFPai, FPai);
//   Application.CreateForm(TFPai, FPai);
end;

procedure TFormPrinc.FormClose(Sender: TObject; var Action: TCloseAction);
begin
   if (Not Msg('Deseja realmente sair do sistema?', 'P')) then // 'I'nfo / 'P'ergunta
      Abort;
   FormPrinc := NIL;
   Application.Terminate;
end;

procedure TFormPrinc.FormCreate(Sender: TObject);
begin
   CaminhoExe := ExtractFilePath(Application.ExeName);
   CriaDM(Normal);
   UserControl1.StartLogin;
end;


end.
